package jp.co.toshiba.ffsa.service.common;

import java.util.List;

import jp.co.toshiba.ffsa.entity.AttachedFile;

public class AttachedFileService  extends AbstractService<AttachedFile> {

    public AttachedFile findById(String projectId,String workflowId,Integer revision,String inOut,String dataType) {
        return select().id(projectId, workflowId, revision, inOut, dataType).getSingleResult();
    }

    public List<AttachedFile> selectAllPaged(int startIndex,int numItems){
        return findAllPaged("projectId, workflowId, revision, inOut, dataType", startIndex, numItems);
    }

    public int deleteItem(String projectId,String workflowId,Integer revision,String inOut,String dataType) {
        AttachedFile attachedFile = findById(projectId, workflowId, revision, inOut, dataType);
        return removeItem(attachedFile);
    }

    public void updateItem(AttachedFile attachedFile){
        update(attachedFile);
    }
}